package com.example.servlet;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;

public class servlet01 extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) {



        ServletContext context=super.getServletContext();
        String param=context.getInitParameter("allproject");
System.out.println(param);

        //获取配置的所有参数名
        Enumeration<String> names=context.getInitParameterNames();//枚举
        while (names.hasMoreElements()){
            String allname=names.nextElement();
            String value=context.getInitParameter(allname);
            System.out.println(allname+":"+value);
        }
    }
}
